import request from '@/utils/request'

 //获取用户权限数据
export async function  getRolers() {
    let res =  await request({
      url: '/Rolers',
      method: 'get',
    })
    return res.data.value;
  }
 //增加用户权限数据
export async function addRoler (roler) {
    let res = await request({
        url: '/Rolers',
        method: 'POST',
        data: roler
    })
    return res.data.value
}

 //删除用户权限数据
 export function removeRoler(id){
    return request({
      url: `/Rolers/${id}`,
      method: 'delete'
    })
    // return  new Promise( async (resolve, reject) => {
    //   var index = datas.findIndex(e=>e.id==id);
    //   datas.splice(index,1);
    //   resolve();
    // });
  }